* gunowner
tab rowngun

generate gun = .
replace gun=1 if rowngun==1
replace gun=0 if rowngun==2
replace gun=0 if owngun==2
tab gun

* gun in home
tab owngun

generate gunhome = .
replace gunhome=1 if owngun==1
replace gunhome=0 if owngun==2
tab gunhome

* women
tab sex

generate women = .
replace women=1 if sex==2
replace women=0 if sex==1
tab women

* age (continuous 19-88 & "89 or older"
tab age

* white
tab race

generate white = .
replace white=1 if race==1
replace white=0 if race==2
replace white=0 if race==3

tab white

* education (high school or less to graduate degree)
tab degree

generate edu = .
replace edu=1 if degree==0
replace edu=1 if degree==1
replace edu=2 if degree==2
replace edu=3 if degree==3
replace edu=4 if degree==4
tab edu

* partyID (strong dem - strong repub)
tab partyid

generate party = .
replace party=1 if partyid==0
replace party=2 if partyid==1
replace party=3 if partyid==2
replace party=4 if partyid==3
replace party=5 if partyid==4
replace party=6 if partyid==5
replace party=7 if partyid==6
tab party


* republican
generate repub = .
replace repub=1 if partyid==4
replace repub=1 if partyid==5
replace repub=1 if partyid==6
replace repub=0 if partyid==0
replace repub=0 if partyid==1
replace repub=0 if partyid==2
replace repub=0 if partyid==3
replace repub=0 if partyid==7
tab repub



* evangelical
tab reborn

generate evang = .
replace evang=1 if reborn==1
replace evang=0 if reborn==2
tab evang

* ideology (extremely liberal - extremely conservative; 7 point scale)
tab polviews

generate ideo = polviews

* partisan strength
tab partyid
tab party

generate pstrength = .
replace pstrength=1 if party==4
replace pstrength=2 if party==5
replace pstrength=2 if party==3
replace pstrength=3 if party==6
replace pstrength=3 if party==2
replace pstrength=4 if party==7
replace pstrength=4 if party==1
tab pstrength


* urban/rural
tab xnorcsiz

generate rural = .
replace rural=1 if xnorcsiz==10
replace rural=1 if xnorcsiz==9
replace rural=1 if xnorcsiz==8
replace rural=0 if xnorcsiz==1
replace rural=0 if xnorcsiz==2
replace rural=0 if xnorcsiz==3
replace rural=0 if xnorcsiz==4
replace rural=0 if xnorcsiz==5
replace rural=0 if xnorcsiz==6
replace rural=0 if xnorcsiz==7

* geographic region
tab region

generate south = .
replace south=1 if region==5
replace south=1 if region==6
replace south=1 if region==7
replace south=0 if region==1
replace south=0 if region==2
replace south=0 if region==3
replace south=0 if region==4
replace south=0 if region==8
replace south=0 if region==9
tab south

* protestmeet (Should the public be allowed to organize meetings to protest the government?)
tab protest1

generate protestmeet1 = .
replace protestmeet1=0 if protestmeet==1
replace protestmeet1=0 if protestmeet==2
replace protestmeet1=1 if protestmeet==3
replace protestmeet1=1 if protestmeet==4
tab protestmeet1

* orgprotest (Should the public be allowed to organize demonstrations to protest the government?)
tab protest3

generate protestdemon1 = .
replace protestdemon1=0 if protestdemon==1
replace protestdemon1=0 if protestdemon==2
replace protestdemon1=1 if protestdemon==3
replace protestdemon1=1 if protestdemon==4
tab protestdemon1

* OLS regression analysis for Gun Owners  *

reg protestmeet1 gun age white women edu party evang ideo pstrength rural south

reg protestdemon1 gun age white women edu party evang ideo pstrength rural south
